<?php

class vunlin_user {

	private $_CI;

	public function __construct() {
		$this -> _CI = &get_instance();
		session_start();
		session_id("123-092");
		session_name("gonna");
	}

	// check using cookie and session
	public function auto_check() {
		if(isset($_SESSION['vunlin_user_logged_in'])){
			echo 'who';
		}
		else{
			$_SESSION['vunlin_user_logged_in'] = 1;
		}
		$username = $this -> _CI -> input -> cookie('username');
		$password = $this -> _CI -> input -> cookie('password');
	}

	public function login($username, $password) {
		setcookie('username', 'user', time() + 60 * 60 * 24 * 30, '/vun', '.vunlin.com');
		setcookie('password', 'pass', time() + 60 * 60 * 24 * 30, '/vun', '.vunlin.com');
	}

	public function logout() {
		
	}

}
